home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2 Examples.sit / Raven 1.2 Examples / BoxPaint / Source / Doc.h < prev    next >
Text File  |  1997-03-09  |  2KB  |  93 lines

  1. /*
  2.  *  File:       Doc.h
  3.  *  Summary:       Document class. 
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <->     5/25/96    JDJ        Created
  12.  */
  13.  
  14. #pragma once
  15.  
  16. #include <Z3DGroups.h>
  17. #include <Z3DMatrix.h>
  18. #include <Z3DStyles.h>
  19. #include <ZDocument.h>
  20.  
  21. #include "Texture.h"
  22.  
  23.  
  24. // ===================================================================================
  25. //    struct S3DScene
  26. // ===================================================================================
  27. struct S3DScene {
  28.     T3DDisplayGroup*        model;
  29.     T3DInterpolationStyle*    interpolation;
  30.     T3DBackfacingStyle*        backFacing;
  31.     T3DFillStyle*            fillStyle;
  32.     T3DMatrix                rotation;
  33. };
  34.  
  35.  
  36. // ===================================================================================
  37. //    class CDocument
  38. // ===================================================================================
  39. class CDocument : public TDocument {
  40.  
  41.     typedef TDocument Inherited;
  42.  
  43. //-----------------------------------
  44. //    Initialization/Destruction
  45. //
  46. public:
  47.     virtual             ~CDocument();
  48.     
  49.                           CDocument(MCommander* super);
  50.  
  51. //-----------------------------------
  52. //    New API
  53. //
  54. public:
  55.             S3DScene     GetScene();
  56.             
  57.             CTextureMap& GetTexture()                            {return mTexture;}
  58.         
  59.             void         TransformModel(const T3DMatrix& matrix);
  60.  
  61. //-----------------------------------
  62. //    Inherited API
  63. //
  64. protected:
  65.     virtual void         OnStreamIn(TInStream& stream, long version);
  66.  
  67.     virtual    void         OnStreamOut(TOutStream& stream) const;
  68.  
  69.     virtual bool         OnMenuCommand(const MenuCommand& command);
  70.         
  71.     virtual bool         OnCommandStatus(const MenuCommand& command, SCommandStatus& status);
  72.     
  73. //-----------------------------------
  74. //    Internal API
  75. //
  76. protected:
  77.             void         CreateModel();
  78.             
  79.             void         RemapTexture(ulong resolution);
  80.  
  81. //-----------------------------------
  82. //    Member Data
  83. //
  84. protected:
  85.     T3DDisplayGroup            mModel;                // object in the scene being modelled
  86.     T3DInterpolationStyle    mInterpolation;        // interpolation style used when rendering
  87.     T3DBackfacingStyle        mBackFacing;        // whether to draw shapes that face away from the camera
  88.     T3DFillStyle            mFillStyle;            // whether drawn as solid filled object or decomposed to components
  89.     T3DMatrix                mRotation;            // the transform for the model
  90.     
  91.     CTextureMap                mTexture;            // the paintable texture
  92. };
  93.